package com.shd.edanpei.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseActivity;
import com.shd.edanpei.base.BaseIPresenter;
import com.shd.edanpei.db.DaoManager;

import butterknife.BindView;
import butterknife.OnClick;


public class PhoneActivity extends BaseActivity {


    @BindView(R.id.headline)
    TextView headline;
    @BindView(R.id.tv_phone)
    TextView tvPhone;

    @Override
    protected int setLayout() {
        return R.layout.activity_phone;
    }

    @Override
    protected BaseIPresenter bindPresenter() {
        return null;
    }

    @Override
    protected void initView(@Nullable Bundle savedInstanceState) {
        headline.setText("绑定手机号");
        tvPhone.setText("您当前手机号：" + DaoManager.getInstance().getUserBean().getMobile());
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        tvPhone.setText("您当前手机号：" + DaoManager.getInstance().getUserBean().getMobile());
    }

    @Override
    protected void initListener() {

    }

    @OnClick({R.id.iv_headline_back, R.id.tv_phone_change})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_headline_back:
                finish();
                break;
            case R.id.tv_phone_change:
                startActivity(PhoneResetActivity.class);
                break;
        }
    }
}
